Dim f1        'fso info
Dim sTest     'string used to test 
Dim sMyPos     'string used for the name
Dim sMyPos1     'string used for the name
Dim iNum    'number for length of string
Dim sData    'holds the display name
Dim sFinal     'end result of loop

Dim oWS : Set oWS = CreateObject("WScript.Shell")
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")

oWS.Run "regedit /e /a tempfile.txt  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", 0, true

on error resume next
'WScript.Sleep 100

Set f1 = ofso.OpenTextFile(".\tempfile.txt", 1, True)

    
Do While Not f1.AtEndOfStream
    sTest = f1.ReadLine
    If InStr(1, sTest, "[HKEY_LOCAL_MACHINE", 1) then
        sMyPos = Mid(sTest, InstrRev(sTest, "\", -1, 1))
         iNum = Len(sMyPos)
        sMyPos1 = Left(sMyPos, iNum - 1)
        'msgbox sMyPos1
      Wscript.Echo oWs.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" & sMyPos1 & "\DisplayName")
      Wscript.Echo  oWs.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" & sMyPos1 & "\DisplayVersion")
        If err <> 0 then
            err.clear
        Else
            sFinal = sFinal & sData & VbCrLf
        End If
    End If
    Set sMyPos = nothing
Loop
    msgbox sFinal
    
f1.close
    
    'use this so i can see all of my results
    Set f1 = ofso.OpenTextFile(".\tempfile.txt", 2, True) 
    f1.writeline sfinal
f1.close    

WScript.Quit